<template>
    <el-input v-model="inputValue" :placeholder='placeholder' @blur="getInputValue" :class="[classStyle]"></el-input>
</template>

<script>
    export default {
        data() {
            return {
                inputValue:'',
                obj:{}
            }
        },
        props:{
            label:[String, Number],
            placeholder:{
                type:String,
                default:''
            },
            classStyle:{
                type:String,
                default:''
            }
        },
        mounted(){
            //同inputnumber.vue
            this.obj[this.label] = ''
            this.$emit('setFormData',this.obj)
        },
        methods:{
            getInputValue(){
                this.obj[this.label] = this.inputValue
                this.$emit('setFormData',this.obj)
            },
            reset(){
                this.inputValue = ''
                this.getInputValue()
            }
        }
    }
</script>

<style lang="less" scoped>
    .el-input.el-input--mini.dialog{
        width: 80%;
    }
</style>